function ShoppingCart(params){ 
	 
}

ShoppingCart.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new ShoppingCart.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new ShoppingCart.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new ShoppingCart.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
	
	/** 商品信息        **/
	this.goods=function(goods){if(this.proxy)return this.getProxy().goods(goods);  this.put("goods", goods);return this;};
	/** and goods is null */
	this.goodsNull=function(){if(this.proxy)return this.getProxy().goodsNull();if(this.get("goodsNot")==null)this.put("goodsNot", "");this.put("goods", null);return this;};
	/** not .... */
	this.goodsNot=function(){if(this.proxy)return this.getProxy().goodsNot();this.put("goodsNot", "not");return this;};
	this.goodsNotNull=function(){if(this.proxy)return this.getProxy().goodsNotNull();this.put("goodsNot", "not");this.put("goods", null);return this;};
	this.goodsNot=function(goods){if(this.proxy)return this.getProxy().goodsNot(goods);this.put("goodsNot", "not");this.put("goods", goods);return this;};
	/** and goods <= ? */
	this.goodsMin=function(min){if(this.proxy)return this.getProxy().goodsMin(min);this.put("goodsMin", min);return this;};
	/** and goods >= ? */
	this.goodsMax=function(max){if(this.proxy)return this.getProxy().goodsMax(max);this.put("goodsMax", max);return this;};
	this.goodsIn=function(ids){
		if(this.proxy)return this.getProxy().goodsIn(ids);  this.put("goodsIn", ids);return this;
	};	
	
	/** 商品名称        **/
	this.names=function(names){if(this.proxy)return this.getProxy().names(names);  this.put("names", names);return this;};
	/** and names is null */
	this.namesNull=function(){if(this.proxy)return this.getProxy().namesNull();if(this.get("namesNot")==null)this.put("namesNot", "");this.put("names", null);return this;};
	/** not .... */
	this.namesNot=function(){if(this.proxy)return this.getProxy().namesNot();this.put("namesNot", "not");return this;};
	this.namesNotNull=function(){if(this.proxy)return this.getProxy().namesNotNull();this.put("namesNot", "not");this.put("names", null);return this;};
	this.namesNot=function(names){if(this.proxy)return this.getProxy().namesNot(names);this.put("namesNot", "not");this.put("names", names);return this;};
	
	/** 价格        **/
	this.price=function(price){if(this.proxy)return this.getProxy().price(price);  this.put("price", price);return this;};
	/** and price is null */
	this.priceNull=function(){if(this.proxy)return this.getProxy().priceNull();if(this.get("priceNot")==null)this.put("priceNot", "");this.put("price", null);return this;};
	/** not .... */
	this.priceNot=function(){if(this.proxy)return this.getProxy().priceNot();this.put("priceNot", "not");return this;};
	this.priceNotNull=function(){if(this.proxy)return this.getProxy().priceNotNull();this.put("priceNot", "not");this.put("price", null);return this;};
	this.priceNot=function(price){if(this.proxy)return this.getProxy().priceNot(price);this.put("priceNot", "not");this.put("price", price);return this;};
	/** and price <= ? */
	this.priceMin=function(min){if(this.proxy)return this.getProxy().priceMin(min);this.put("priceMin", min);return this;};
	/** and price >= ? */
	this.priceMax=function(max){if(this.proxy)return this.getProxy().priceMax(max);this.put("priceMax", max);return this;};
	
	/** 数量        **/
	this.count=function(count){if(this.proxy)return this.getProxy().count(count);  this.put("count", count);return this;};
	/** and count is null */
	this.countNull=function(){if(this.proxy)return this.getProxy().countNull();if(this.get("countNot")==null)this.put("countNot", "");this.put("count", null);return this;};
	/** not .... */
	this.countNot=function(){if(this.proxy)return this.getProxy().countNot();this.put("countNot", "not");return this;};
	this.countNotNull=function(){if(this.proxy)return this.getProxy().countNotNull();this.put("countNot", "not");this.put("count", null);return this;};
	this.countNot=function(count){if(this.proxy)return this.getProxy().countNot(count);this.put("countNot", "not");this.put("count", count);return this;};
	/** and count <= ? */
	this.countMin=function(min){if(this.proxy)return this.getProxy().countMin(min);this.put("countMin", min);return this;};
	/** and count >= ? */
	this.countMax=function(max){if(this.proxy)return this.getProxy().countMax(max);this.put("countMax", max);return this;};
	this.countIn=function(ids){
		if(this.proxy)return this.getProxy().countIn(ids);  this.put("countIn", ids);return this;
	};	
	
	/** 图片        **/
	this.img=function(img){if(this.proxy)return this.getProxy().img(img);  this.put("img", img);return this;};
	/** and img is null */
	this.imgNull=function(){if(this.proxy)return this.getProxy().imgNull();if(this.get("imgNot")==null)this.put("imgNot", "");this.put("img", null);return this;};
	/** not .... */
	this.imgNot=function(){if(this.proxy)return this.getProxy().imgNot();this.put("imgNot", "not");return this;};
	this.imgNotNull=function(){if(this.proxy)return this.getProxy().imgNotNull();this.put("imgNot", "not");this.put("img", null);return this;};
	this.imgNot=function(img){if(this.proxy)return this.getProxy().imgNot(img);this.put("imgNot", "not");this.put("img", img);return this;};
	
	/** 充        **/
	this.chong=function(chong){if(this.proxy)return this.getProxy().chong(chong);  this.put("chong", chong);return this;};
	/** and chong is null */
	this.chongNull=function(){if(this.proxy)return this.getProxy().chongNull();if(this.get("chongNot")==null)this.put("chongNot", "");this.put("chong", null);return this;};
	/** not .... */
	this.chongNot=function(){if(this.proxy)return this.getProxy().chongNot();this.put("chongNot", "not");return this;};
	this.chongNotNull=function(){if(this.proxy)return this.getProxy().chongNotNull();this.put("chongNot", "not");this.put("chong", null);return this;};
	this.chongNot=function(chong){if(this.proxy)return this.getProxy().chongNot(chong);this.put("chongNot", "not");this.put("chong", chong);return this;};
	/** and chong <= ? */
	this.chongMin=function(min){if(this.proxy)return this.getProxy().chongMin(min);this.put("chongMin", min);return this;};
	/** and chong >= ? */
	this.chongMax=function(max){if(this.proxy)return this.getProxy().chongMax(max);this.put("chongMax", max);return this;};
	this.chongIn=function(ids){
		if(this.proxy)return this.getProxy().chongIn(ids);  this.put("chongIn", ids);return this;
	};	
	
	/** 赠        **/
	this.zeng=function(zeng){if(this.proxy)return this.getProxy().zeng(zeng);  this.put("zeng", zeng);return this;};
	/** and zeng is null */
	this.zengNull=function(){if(this.proxy)return this.getProxy().zengNull();if(this.get("zengNot")==null)this.put("zengNot", "");this.put("zeng", null);return this;};
	/** not .... */
	this.zengNot=function(){if(this.proxy)return this.getProxy().zengNot();this.put("zengNot", "not");return this;};
	this.zengNotNull=function(){if(this.proxy)return this.getProxy().zengNotNull();this.put("zengNot", "not");this.put("zeng", null);return this;};
	this.zengNot=function(zeng){if(this.proxy)return this.getProxy().zengNot(zeng);this.put("zengNot", "not");this.put("zeng", zeng);return this;};
	/** and zeng <= ? */
	this.zengMin=function(min){if(this.proxy)return this.getProxy().zengMin(min);this.put("zengMin", min);return this;};
	/** and zeng >= ? */
	this.zengMax=function(max){if(this.proxy)return this.getProxy().zengMax(max);this.put("zengMax", max);return this;};
	this.zengIn=function(ids){
		if(this.proxy)return this.getProxy().zengIn(ids);  this.put("zengIn", ids);return this;
	};	
	
	/** 用户信息        **/
	this.member=function(member){if(this.proxy)return this.getProxy().member(member);  this.put("member", member);return this;};
	/** and member is null */
	this.memberNull=function(){if(this.proxy)return this.getProxy().memberNull();if(this.get("memberNot")==null)this.put("memberNot", "");this.put("member", null);return this;};
	/** not .... */
	this.memberNot=function(){if(this.proxy)return this.getProxy().memberNot();this.put("memberNot", "not");return this;};
	this.memberNotNull=function(){if(this.proxy)return this.getProxy().memberNotNull();this.put("memberNot", "not");this.put("member", null);return this;};
	this.memberNot=function(member){if(this.proxy)return this.getProxy().memberNot(member);this.put("memberNot", "not");this.put("member", member);return this;};
	/** and member <= ? */
	this.memberMin=function(min){if(this.proxy)return this.getProxy().memberMin(min);this.put("memberMin", min);return this;};
	/** and member >= ? */
	this.memberMax=function(max){if(this.proxy)return this.getProxy().memberMax(max);this.put("memberMax", max);return this;};
	this.memberIn=function(ids){
		if(this.proxy)return this.getProxy().memberIn(ids);  this.put("memberIn", ids);return this;
	};	
	
	/** 属性        **/
	this.attribute=function(attribute){if(this.proxy)return this.getProxy().attribute(attribute);  this.put("attribute", attribute);return this;};
	/** and attribute is null */
	this.attributeNull=function(){if(this.proxy)return this.getProxy().attributeNull();if(this.get("attributeNot")==null)this.put("attributeNot", "");this.put("attribute", null);return this;};
	/** not .... */
	this.attributeNot=function(){if(this.proxy)return this.getProxy().attributeNot();this.put("attributeNot", "not");return this;};
	this.attributeNotNull=function(){if(this.proxy)return this.getProxy().attributeNotNull();this.put("attributeNot", "not");this.put("attribute", null);return this;};
	this.attributeNot=function(attribute){if(this.proxy)return this.getProxy().attributeNot(attribute);this.put("attributeNot", "not");this.put("attribute", attribute);return this;};
	
	/** 品牌        **/
	this.brand=function(brand){if(this.proxy)return this.getProxy().brand(brand);  this.put("brand", brand);return this;};
	/** and brand is null */
	this.brandNull=function(){if(this.proxy)return this.getProxy().brandNull();if(this.get("brandNot")==null)this.put("brandNot", "");this.put("brand", null);return this;};
	/** not .... */
	this.brandNot=function(){if(this.proxy)return this.getProxy().brandNot();this.put("brandNot", "not");return this;};
	this.brandNotNull=function(){if(this.proxy)return this.getProxy().brandNotNull();this.put("brandNot", "not");this.put("brand", null);return this;};
	this.brandNot=function(brand){if(this.proxy)return this.getProxy().brandNot(brand);this.put("brandNot", "not");this.put("brand", brand);return this;};
	/** and brand <= ? */
	this.brandMin=function(min){if(this.proxy)return this.getProxy().brandMin(min);this.put("brandMin", min);return this;};
	/** and brand >= ? */
	this.brandMax=function(max){if(this.proxy)return this.getProxy().brandMax(max);this.put("brandMax", max);return this;};
	this.brandIn=function(ids){
		if(this.proxy)return this.getProxy().brandIn(ids);  this.put("brandIn", ids);return this;
	};	
	
	/** 选择        **/
	this.select=function(select){if(this.proxy)return this.getProxy().select(select);  this.put("select", select);return this;};
	/** and select is null */
	this.selectNull=function(){if(this.proxy)return this.getProxy().selectNull();if(this.get("selectNot")==null)this.put("selectNot", "");this.put("select", null);return this;};
	/** not .... */
	this.selectNot=function(){if(this.proxy)return this.getProxy().selectNot();this.put("selectNot", "not");return this;};
	this.selectNotNull=function(){if(this.proxy)return this.getProxy().selectNotNull();this.put("selectNot", "not");this.put("select", null);return this;};
	this.selectNot=function(select){if(this.proxy)return this.getProxy().selectNot(select);this.put("selectNot", "not");this.put("select", select);return this;};
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有购物车 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/users/shoppingcart.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取购物车分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/users/shoppingcart.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取购物车 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/users/shoppingcart.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

ShoppingCart.get = function(id){
	var protocol = ux.ajax("/admin/users/shoppingcart.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.shoppingCart;
	return null;
}

ShoppingCart.where = new ShoppingCart.Where(0,true);